<?php

namespace Narti\BouncerBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;


use Narti\BouncerBundle\Form\RegistrationType;
use Narti\BouncerBundle\Form\Registration;


/**
 * Register controller.
 *
  * @Route("/account")
 */
class AccountController extends Controller
{
    /**
     * Utilizzato per procedura di registrazione nuovo account
     *
     * @Route("/register", name="account_register")
     * @Template()
     */
    public function registerAction()
    {
        $entity = new Registration();
        $form = $this->createForm(new RegistrationType(), $entity);
        
        return array(
           'entity' => $entity,
           'form'   => $form->createView()
        );
       // return $this->render('NartiBounceBundle:Account:register.html.twig', array('form' => $form->createView()));
  

       // return $this->render('NartiBouncerBundle:Secured:unauth.html.twig');

    }
    
     /**
     * Creazione nuovo account
     *
     * @Route("/create", name="account_create")
     * @Method("post")
     * @Template()
     */
    public function createAction()
    {
                
        $entity = new Registration();
        $form = $this->createForm(new RegistrationType(), $entity);
        
        return array(
           'entity' => $entity,
           'form'   => $form->createView()
        );

       

    }
    
}
